/*------------------------------------------------------------------------------

 Copyright 2007 Luc Fourestier

 The copyright to the computer program(s) herein is the property of Luc
 Fourestier. The program(s) may be used and/or copied only with the written
 permission of Luc Fourestier or in accordance with the terms and conditions
 stipulated in the agreement/contract under which the program(s) have been
 supplied.

 Contact: luc.fourestier@gmail.com

------------------------------------------------------------------------------*/
/**
 @file    ns16550.h

          This file provides .

 @author  Luc Fourestier
 @version 0.1
 @date    2007

*/
/*----------------------------------------------------------------------------*/

#ifndef NS16550_H
#define NS16550_H

/*------------------------------------------------------------------------------
 Includes
------------------------------------------------------------------------------*/

#include "colibri.h"


/*------------------------------------------------------------------------------
 Return status
------------------------------------------------------------------------------*/

#define NS16550_STATUS_INIT_ERROR         0x1
#define NS16550_STATUS_FINALIZE_ERROR     0x2

/*------------------------------------------------------------------------------
 Functions
------------------------------------------------------------------------------*/

/**
 @brief  Initialise
*/
Status_t ns16550_Initialise(void);



/**
 @brief  Deinitialise
*/
Status_t ns16550_Finalise(void);



/**
 @brief  Search for the UARTs
*/
Status_t ns16550_Search(void);



/**
 @brief  Reserve the UART
*/
Status_t ns16550_Reserve(void);



/**
 @brief  Unreserve the UART
*/
Status_t ns16550_Unreserve(void);



/**
 @brief  Read data inside the UART
*/
Status_t ns16550_Read(int Offset, uint8_t * Buffer, int ReadSize);



/**
 @brief  Write data inside the UART
*/
Status_t ns16550_Write(int Offset, uint8_t * Buffer, int WriteSize);



/**
 @brief  Control the UART
*/
Status_t ns16550_Control(void);



#endif /* NS16550_H */
